<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researchsubject.domain.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.page.PageUtil,com.hs.core.utils.*,cn.ac.cintcm.dataconverge.researcher.domain.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants;"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
PageUtil pageUtil = (PageUtil)request.getAttribute("docList");
List resultList = null;
String pageStr = ""; 
int perpageCount = 1;
int currentPage = 1;
if(null != pageUtil){
   resultList = pageUtil.getPageList();
   pageStr = pageUtil.getPageStr();
   perpageCount = pageUtil.getNumberPerPage();
   currentPage = pageUtil.getCurrentPage();
}
String title = (String)request.getAttribute("title"); 
String uploadUser = (String)request.getAttribute("uploadUser"); 
String orderName = (String)request.getAttribute("orderName");
String orderNum = (String)request.getAttribute("orderNum"); 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>课题信息</title>
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <link href="<%=path%>/index/Themes/com/style.css" rel="stylesheet" type="text/css" /> 
    <script src="<%=path%>/index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=path%>/js/common.js" language="javascript" type="text/javascript"></script>
       <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script>
   
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" type="text/javascript">
       function delSubject(id){
       		if(null != id && id != '' ){
       		 	if(confirm("确认删除课题?")){
       		 		form1.action = '<%=path%>/subjectToAdd.htm?action=delSubject&id='+id;
       		 		form1.submit();
       		 	}
       		}
       
       }
       
       function searchSubject(){  
       			searchform.submit();			
       }
       var selectSubjectId = '';
       function submitAudit(subjectId){
          if(confirm('课题提交审批后将不能修改，确认提交?')){
	          if('' != subjectId){
	          	subject.submitAudit(subjectId,submitCallback)
	            selectSubjectId = subjectId;
	          }  
	      }
       }
        
       function uploadFile(){
       			openwindow('<%=path %>/document.htm?action=docUpload','600','400','');
       			 
       
       }
       function deleteFile(fileId){
           if(confirm("确人要删除该文件？")){
                form1.action = "<%=path %>/document.htm?action=deleteDoc&fileId="+fileId;
                form1.submit();
           }
       
       
       }
    </script>

</head>
<body class="rtm_body" scroll=yes>
<form name="searchform" action = "<%=path%>/document.htm?action=docList" method="post">
    <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <span>
                <img src="<%=path%>/index/Themes/com/idt_tb_pass.gif" />&nbsp;&nbsp;历年文档上传</span>
        </div>
    </div>  
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
         <tr>
            <td class="fim_l" width="10%">
                文档名称：</td>
            <td class="fim_r" width="40%">
                <input type="text" name="title" value="<%=title==null?"":title %>" class="com_textbox" ></td>
             
            <td class="fim_l" width="10%">
                上传人：</td>
            <td class="fim_r" nowrap width="25%">
                <input type="text" name="uploadUser" value="<%=uploadUser==null?"":uploadUser %>" class="com_textbox" ></td>
             
            <td class="fim_r" align="right" colspan="2">
                <input type="submit" value="查询"  onclick="searchSubject()" class="com_btn2" id="Button5">
                <input type="button" value="文档上传"   onclick="uploadFile();" class="com_btn2" id="Button1">
                
            </td>
        </tr> 
        </form>
    </table> 
   
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td>
                <div class="content">
                 <form name="form1" action="" method="post">
                    <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4">
                        <tr>
                            
                            <td class="dg_headerstyle">
                                序号</td>  
                                 <td class="dg_headerstyle" >
                                 <a href="javaScript:orderPage('type','<%=OrderTool.getOrderNum("type",orderName,orderNum)%>');">文档类型&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("type",orderName,orderNum))%></a></td>
                                  <td class="dg_headerstyle" >
                                 <a href="javaScript:orderPage('title','<%=OrderTool.getOrderNum("title",orderName,orderNum)%>');">文档名称&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("title",orderName,orderNum))%></a></td>
                                 
                                   <td class="dg_headerstyle" >
                                 <a href="javaScript:orderPage('uploadUser.name','<%=OrderTool.getOrderNum("uploadUser.name",orderName,orderNum)%>');">上传人&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("uploadUser.name",orderName,orderNum))%></a></td>
                                  <td class="dg_headerstyle" >
                                 上传单位</td>
                                 <td class="dg_headerstyle" >
                                 <a href="javaScript:orderPage('uploaddate','<%=OrderTool.getOrderNum("uploaddate",orderName,orderNum)%>');">上传时间&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("uploaddate",orderName,orderNum))%></a></td>
                                <td class="dg_headerstyle" >
                                备注</td>
                                <td class="dg_headerstyle">
                                操作</td> 
                           
                        </tr> 
                         <%  
                             if(null != resultList && resultList.size()!=0){  
                            		 for(int i =0;i<resultList.size();i++) {
                            		   		ResmanDocument rd = (ResmanDocument)resultList.get(i);
                             %>    
                        <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                             
                            <td width="5%" align="center" ><%= perpageCount*(currentPage-1)+i+1 %></td>
                             <td width="15%" align="center"><%=rd.getDictType()==null?"":rd.getDictType().getName()%></td>
                              <td width="30%"><%=rd.getTitle()==null?"":rd.getTitle() %></td>
                             <td width="10%" align="center"><%=rd.getUploadUser()==null?"":rd.getUploadUser().getName() %></td>
                              <td width="10%" align="center">
                              <%if(rd.getUploadUser()!= null && null != rd.getUploadUser().getOrg() ){
                            	   out.println(rd.getUploadUser().getOrg().getName());
                              }
                                 %></td>
                             <td width="10%" align="center"><%=Tools.getDateStringByDate1(rd.getUploaddate()) %></td>
                             <td width="10%" align="center"><%=rd.getRemarks()==null?"":rd.getRemarks() %></td>
                             <td align="center" width="10%"><a href="<%=path %>/document.htm?action=downloadFile&fileId=<%=rd.getId() %>">下载</a>&nbsp;&nbsp;<a href="javaScript:deleteFile('<%=rd.getId() %>')">删除</a></td>
                             </tr>  
                             
                        <%}}else{%>
                         <tr class="dg_alternatingitemstyle"> 
                            <td align="center" colspan=12>
                                <font color="red">没有找到记录</font>
                            </td> 
                        </tr> 
                        <%}%>
                    </table>
                    </form>
                    <div class="dg_pagerstyle" align="right"> 
                            <%=pageStr %>  
                    </div>
                    
                </div>
            </td>
        </tr>
    </table>
</body>
</html>
